import Vue from "vue";
import Vuex from "vuex";
import shopcar from "./shopCar/index";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    isLogin: false,
    userinfo: {
      avatar: "image/myavatar.png",
      nikename: "心不为所动，随风去啦！",
      myOrder: [
        {
          name: "娃娃菜炖豆腐",
          "price|10-20": 20,
          oldPrice: "",
          description: "",
          sellCount: 43,
          rating: 92,
          info: "",
          ratings: [
            {
              username: "3******c",
              rateTime: 1469281964000,
              rateType: 0,
              text: "菜量还可以,味道还可以",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
            {
              username: "2******3",
              rateTime: 1469271264000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
          ],
          icon: "http://fuss10.elemecdn.com/d/2d/b1eb45b305635d9dd04ddf157165fjpeg.jpeg?imageView2/1/w/114/h/114",
          image:
            "http://fuss10.elemecdn.com/d/2d/b1eb45b305635d9dd04ddf157165fjpeg.jpeg?imageView2/1/w/750/h/750",
        },
        {
          name: "手撕包菜",
          price: 16,
          oldPrice: "",
          description: "",
          sellCount: 29,
          rating: 100,
          info: "",
          ratings: [
            {
              username: "3******c",
              rateTime: 1469281964000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
            {
              username: "2******3",
              rateTime: 1469271264000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
          ],
          icon: "http://fuss10.elemecdn.com/9/c6/f3bc84468820121112e79583c24efjpeg.jpeg?imageView2/1/w/114/h/114",
          image:
            "http://fuss10.elemecdn.com/9/c6/f3bc84468820121112e79583c24efjpeg.jpeg?imageView2/1/w/750/h/750",
        },
        {
          name: "香酥黄金鱼/3条",
          price: 11,
          oldPrice: "",
          description: "",
          sellCount: 15,
          rating: 100,
          info: "",
          ratings: [
            {
              username: "3******c",
              rateTime: 1469281964000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
            {
              username: "2******3",
              rateTime: 1469271264000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
          ],
          icon: "http://fuss10.elemecdn.com/4/e7/8277a6a2ea0a2e97710290499fc41jpeg.jpeg?imageView2/1/w/114/h/114",
          image:
            "http://fuss10.elemecdn.com/4/e7/8277a6a2ea0a2e97710290499fc41jpeg.jpeg?imageView2/1/w/750/h/750",
        },
        {
          name: "红豆薏米美肤粥",
          price: 12,
          oldPrice: "",
          description: "甜粥",
          sellCount: 86,
          rating: 100,
          info: "美肤粥对皮肤有很好的保养作用",
          ratings: [
            {
              username: "3******c",
              rateTime: 1469281964000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
            {
              username: "2******3",
              rateTime: 1469271264000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
            {
              username: "3******b",
              rateTime: 1469261964000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
          ],
          icon: "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/114/h/114",
          image:
            "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/750/h/750",
          images: [
            "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/750/h/750",
            "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/750/h/750",
            "http://fuss10.elemecdn.com/d/22/260bd78ee6ac6051136c5447fe307jpeg.jpeg?imageView2/1/w/750/h/750",
          ],
        },
        {
          name: "八宝酱菜",
          price: 4,
          oldPrice: "",
          description: "",
          sellCount: 84,
          rating: 100,
          info: "八宝酱菜八宝酱菜八宝酱菜八宝酱菜八宝酱菜",
          ratings: [
            {
              username: "3******c",
              rateTime: 1469281964000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
            {
              username: "2******3",
              rateTime: 1469271264000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
            {
              username: "3******b",
              rateTime: 1469261964000,
              rateType: 0,
              text: "",
              avatar:
                "http://static.galileo.xiaojukeji.com/static/tms/default_header.png",
            },
          ],
          icon: "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/114/h/114",
          image:
            "http://fuss10.elemecdn.com/9/b5/469d8854f9a3a03797933fd01398bjpeg.jpeg?imageView2/1/w/750/h/750",
        },
      ],
    },
  },
  getters: {},
  mutations: {
    setLogin(state, payload) {
      state.isLogin = payload;
    },
    isLogin(state, cb) {
      cb(state.isLogin);
    },
  },
  actions: {},
  modules: {
    shopcar,
  },
});
